"""
Allows user creation with the email address instead of the username
"""
from django.contrib.auth.models import User, UserManager

def create_user_from_email(mail, send_activation_mail=False):
    password = User.objects.make_random_password(length=8)
    
    if send_activation_mail:
        # Code to send the activation email
        pass
    
    return User.objects.create_user(mail, mail, password)